package demo;

import java.util.concurrent.TimeUnit;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        System.out.println("A");
          //毫秒为单位
        Thread.sleep(3000);
        //3秒后才会打印B
        System.out.println("B");


        //3秒
        TimeUnit.SECONDS.sleep(3);
        //3小时
        TimeUnit.HOURS.sleep(3);
    }
}
